Feat/phase3 rag pipeline - #16
Merged
Merged
Conversation
added 2 commits
June 5, 2026 17:46
New endpoints: - POST /tools/search — hybrid dense + sparse retrieval with RRF fusion - POST /tools/chat — RAG chat powered by Claude API Infrastructure: - BGE-M3 embedding model (lazy singleton, CPU) - Sparse vector storage via pgvector sparsevec(250002) - New config: CHATBOT_SPARSE_DIMENSION, RRF_K, SEARCH_CANDIDATES, MAX_CONTEXT_CHUNKS, LLM_API_KEY, LLM_MODEL Tests: 53 passing (contract, router, service) Closes #16
- Anthropic Claude -> Gemini -> raw context fallback when no keys - Add CHATBOT_GEMINI_API_KEY / CHATBOT_GEMINI_MODEL settings - Update rag-pipeline.md spec with fallback behavior and config vars - Remove dead code in _call_gemini (unreachable guard) - Clean leaked API key placeholder in integration.md - Add test coverage for no-LLM-key fallback path
Test Coverage
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
- test_llm_caller.py: Gemini success/api-error/malformed, Anthropic success, Anthropic fallback to Gemini (5 tests) - test_models.py: Article and ArticleChunk __repr__ (2 tests) - Coverage: 81% -> 90%, service.py: 78% -> 98%
…nAI-compatible /v1/chat/completions Breaking changes: - Remove all /tools/* endpoints (chunks, search, chat) - Add single OpenAI-compatible POST /v1/chat/completions endpoint - Extract all SDK logic into separate chatbot-plugin-sdk package - Remove redundant local code: config, db, embedding, models, service, contracts/requests, contracts/responses - Import DB, models, contracts, exceptions, RagQueryProcessor from chatbot_plugin_sdk - Update main.py lifespan to initialize RagQueryProcessor from SDK - Update tests to mock RagQueryProcessor and test /v1/chat/completions - Update spec: add SDK Usage chapter, update class hierarchy to BaseRagProcessor / RagArticleProcessor / RagQueryProcessor - Update pyproject.toml: remove LLM/db dependencies (moved to SDK) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add chatbot-plugin-sdk to main dependencies - Add httpx to dev dependencies for ASGITransport/AsyncClient in tests - Bump version to 0.3.0 - Add pytest.xml and coverage.xml to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.